import requests
import datetime

start_time = 1451606400*1000
url = f"https://api.binance.com/api/v3/klines?symbol=BTCUSDT&interval=1d&startTime={start_time}"
response = requests.get(url)
data = response.json()
begin_time = datetime.datetime.fromtimestamp(data[0][0]/1000)
end_time = datetime.datetime.fromtimestamp(data[-1][0]/1000)

print(data)